#!/usr/bin/python
# -*- coding: UTF-8 -*-
from Config import *
import pymysql

db=pymysql.connect(host=MYSQL_URL,db=MYSQL_TABLE,user=MYSQL_USER,passwd=MYSQL_PAW,charset="utf8")
cursor=db.cursor()

sql_1="select * from emp where empno>7000"
sql_2="select count(*) from emp where deptno=30"
sql_3="select count(*),sum(sal),avg(sal) from emp where ename LIKE '%NE%'"

#多表
sql_4="select ename,dname from emp ,dept WHERE empno >7750 and emp.deptno=dept.deptno"

cursor.execute(sql_4)
db.commit()

resutl=cursor.fetchall()
print(resutl)
